package com.ksc.storekeeper.client.view.validation;

import java.util.HashMap;
import java.util.Map;

public class ErrorMessages {

	private ErrorMessages() {

	}

	public static final String TOO_SHORT = "Length is short.";
	public static final String TOO_LONG = "Length is long.";
	public static final String REQUIRED = "This field is required.";
	public static final String NOT_NUMERIC = "Numbers only";
	public static final String NOT_ALPHABHETIC = "Characters only";
	public static final String NOT_ALPHANUMERIC = "Digit and characters only";
	public static final String PASS_NOT_NUMERIC = "Password must be 6 character long and may contain digit";
	public static final String PASS_NOT_ALPHABHETIC = "Password must be 6 character long and may contain alphabet";
	public static final String PASS_NOT_ALPHANUMERIC = "Password must be 6 character long and may contain alphanumeric character and some special characters";
	public static final String INVALID_ADSL_USERNAME = "Invalid ADSL username";
	public static final String INVALID_MOBILE_NUMBER = "Invalid mobile number";
	public static final String PASSWORD_MISMATCH = "Password don't match.";
	public static final String INVALID_EMAIL_ID = "Invalid email Id";
	public static final String INVALID_LANDLINE_NUMBER = "Invalid landline number";
	public static final String INVALID_LANDLINE_NUMBER_LENGTH = "Landline number must be 8 digits";
	public static final String WHITESPACES_ONLY = "No whitespaces";
	public static final String INVALID_GSM_NUMBER = "Invalid GSM number";
	public static final String INVALID_CDMA_NUMBER = "Invalid CDMA number";
	public static final String LESS_THAN_ZERO = "Should be greater than 0";
	public static final String INVALID_GSM_POSTPAID_NUMBER = "Invalid GSM postpaid number";
	public static final String INVALID_NCELL_POSTPAID_NUMBER = "Invalid NCell postpaid number";
	public static final String INVALID_CDMA_POSTPAID_NUMBER = "Invalid CDMA postpaid number";
	private static final String INVALID_CONTACT_NUMBER = "Invalid contact number";
	private static final String INVALID_DATE = "Invalid date";
	private static final Map<String, String> map = new HashMap<String, String>();

	public static void errorMessage() {
		map.put("TOO_SHORT", TOO_SHORT);
		map.put("TOO_LONG", TOO_LONG);
		map.put("REQUIRED", REQUIRED);
		map.put("NOT_NUMERIC", NOT_NUMERIC);
		map.put("NOT_ALPHABHETIC", NOT_ALPHABHETIC);
		map.put("NOT_ALPHANUMERIC", NOT_ALPHANUMERIC);
		map.put("PASS_NOT_NUMERIC", PASS_NOT_NUMERIC);
		map.put("PASS_NOT_ALPHABHETIC", PASS_NOT_ALPHABHETIC);
		map.put("PASS_NOT_ALPHANUMERIC", PASS_NOT_ALPHANUMERIC);
		map.put("INVALID_ADSL_USERNAME", INVALID_ADSL_USERNAME);
		map.put("INVALID_EMAIL_ID", INVALID_EMAIL_ID);
		map.put("INVALID_LANDLINE_NUMBER", INVALID_LANDLINE_NUMBER);
		map.put("INVALID_LANDLINE_NUMBER_LENGTH", INVALID_LANDLINE_NUMBER_LENGTH);
		map.put("INVALID_MOBILE_NUMBER", INVALID_MOBILE_NUMBER);
		map.put("INVALID_GSM_NUMBER", INVALID_GSM_NUMBER);
		map.put("INVALID_CDMA_NUMBER", INVALID_CDMA_NUMBER);
		map.put("LESS_THAN_ZERO", LESS_THAN_ZERO);
		map.put("INVALID_GSM_POSTPAID_NUMBER", INVALID_GSM_POSTPAID_NUMBER);
		map.put("INVALID_CDMA_POSTPAID_NUMBER", INVALID_CDMA_POSTPAID_NUMBER);
		map.put("WHITESPACES", WHITESPACES_ONLY);
		map.put("INVALID_CONTACT_NUMBER", INVALID_CONTACT_NUMBER);
		map.put("INVALID_NCELL_POSTPAID_NUMBER", INVALID_NCELL_POSTPAID_NUMBER);
		map.put("INVALID_DATE", INVALID_DATE);

	}

	public static String getErrorMessage(String errorCode) {
		errorMessage();
		return map.get(errorCode);
	}
}
